-- intelligence_pc
-- created by cheny3
-- 地牢格子：智能电脑

return {
    restoreGrid = function(grid, info)
        -- 还原
        -- 如果是智能电脑
        if grid.type == GRID_TYPE_INTELLIGENCE_PC then
            if type(info["bonus_id"]) == "number" then
                grid.bonus_id = info["bonus_id"];
            else
                grid.bonus_id = nil;
            end

            grid.news_ids = info["news_ids"] or {};
        end
    end,

    collectContext = function(grid)
        -- 收集
        local ret = {};

        -- 如果是智能电脑
        if grid.type == GRID_TYPE_INTELLIGENCE_PC then
            if type(grid.bonus_id) == "number" then
                ret["bonus_id"] = grid.bonus_id;
            end

            ret["news_ids"] = grid.news_ids or {};
        end

        return ret;
    end,
};
